/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/


#ifndef GPX_H
#define GPX_H

#include <QObject>
#include <QtCore>

#include "trackpoint.h"
#include "keymaze300reader.h"

#define GPX_NL  "\n"

class GPX : public QObject
{
    Q_OBJECT
public:
    explicit GPX(QObject *parent = 0);

signals:

public slots:
    void writeFile(QString src); /* write gpx file from one keymaze 300 txt
                                    if source have multiple tracks, stores each
                                    one in multiple gpx files*/



private:
    QString writeHeader();              /* write gpx file header */
    QString writePoints(int trk_num);   /* write desired track points */
    QString writeFooter();              /* Write gpx file footer  */

    QFile * gpx_file;                   /* pointer to gpx file  */
    QString gpx_file_name;              /* gpx file name */
    QString txt_file_name;              /* txt file name */
    Keymaze300Reader txt_file;          /* keymaze 300 file reader */



};

#endif // GPX_H
